<template>
	<view>
		<u-empty mode="car" icon="http://cdn.uviewui.com/uview/empty/coupon.png" :text="bindResult?'绑定成功':'绑定失败，请登录后重试'"
			width="300px" textColor="#99c0ff" textSize="24px">
		</u-empty>

		<view style="margin: 190rpx;width: 175px;">
			<u-button text="返回首页" type="primary" shape="circle" @click="back"></u-button>
			<u-button text="去关注公众号" type="info" shape="circle" @click="goMpGzh"></u-button>
		</view>
	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				bindResult: false
			}
		},
		onLoad(e) {
			console.log("e: ", e);
			//发起绑定请求
			this.$axios({
				url: "user/info/bindMpOpenId",
				method: "post",
				data: {
					mpOpenId: e.mpOpenId
				}
			}).then((res) => {
				if (res.code == 0) {
					this.bindResult = true
				}
			})
		},
		methods: {
			back() {
				uni.switchTab({
					url: "/pages/growVegetables/growVegetables"
				})
			},
			goMpGzh() {
			uni.navigateTo({
				url:"/pageA/gzGzh/gzMpGzh"
			})
			}

		}
	}
</script>

<style>

</style>
